<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>渐变色</title>
</head>

<style>
div{
    background:linear-gradient(red,yellow,blue);

}

</style>

<body>
    <div id="bg">
        <div id="box">
            <p id="text" b>background: linear-gradient(45deg, blue, red)</p>
            <div class="box-btn">
                <button id="change">生成</button>
                <button id="copytext">复制</button>
            </div>


        </div>

    </div>
    
</body>

<!-- <script>
    let obj = document.getElementById("bg");
    let color1 = document.getElementById("color1");
    let color2 = document.getElementById("color2");


function randomColor(){
    let array = [];
    let str = "#";
    let str1 = "#";
    let arr = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
    for (var i = 0; i < 6; i++) {
                var num = parseInt(Math.random() * 16);
                var num1 = parseInt(Math.random() * 16);
                str += arr[num]
                str1 += arr[num1]
            }
            aray = [str, str1];
            return aray;
        }

   



</script> -->
</html>